import tensorflow as tf
import numpy as np


x=[[1,3],[8,12]]
a=tf.reduce_mean(x)
b=tf.reduce_mean(x,0)
c=tf.reduce_mean(x,1)
d=tf.reduce_max(x)
e=tf.square(x)
f=tf.reduce_sum(x)

g = tf.constant([1, 2, 3, 4, 5, 6], shape=[2, 3]) 
#=> [[1. 2. 3.]
#    [4. 5. 6.]]
# 2-D tensor `b`
h = tf.constant([7, 8, 9, 10, 11, 12], shape=[3, 2]) 
#=> [[7. 8.]
#    [9. 10.]
#    [11. 12.]]
#c = tf.matmul(a, b) 
#=> [[58 64]
#    [139 154]]
#valid_examples = np.random.choice()
i =tf.matmul(g,h)

input1 = tf.constant(3.0)
input2 = tf.constant(2.0)
input3 = tf.constant(5.0)
intermed = tf.add(input2, input3)
mul = tf.multiply(input1, intermed)

init = tf.global_variables_initializer()
with tf.Session() as sess:
    sess.run(init)
    print(sess.run(a))
    print('====================================')
    print(sess.run(b))
    print('====================================')
    print(sess.run(c))
    print(sess.run(d))
    print(sess.run(e))
    print(sess.run(f))
    print("====================================")
    print(g)
    print(h)
    print(sess.run(i))
    print("====================================")
    result = sess.run([mul, intermed])
    print(result)


